package DealCard;

import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ThreadMain extends Thread {

    ArrayList<ThreadImages> arrThreadImages = null;

    @SuppressWarnings("CallToThreadStartDuringObjectConstruction")
    public ThreadMain(ArrayList<ThreadImages> arrThreadImages) {
        this.arrThreadImages = arrThreadImages;
        start();
    }

    @Override
    @SuppressWarnings("SleepWhileInLoop")
    public void run() {
        for (ThreadImages thrImages : arrThreadImages) {
            try {
                thrImages.start();
                sleep(50); // Khoảng cách chia bài
            } catch (InterruptedException ex) {
                Logger.getLogger(ThreadMain.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
}
